#!/bin/bash

. /usr/local/src/beetle-vm-init/common/common.sh

app=$1;

area=$2;

logPath="";

function main(){

	if [[ -z "$area" ]]; then
		#statements
		area="gzidc"
	fi

	ASSERT_NOT_EMPTY "$app" "请输入/usr/local/app/*gzidc*/下的应用名称";

	if [[ "erp" == "$app" ]]; then
		logPath="/usr/local/app/*gzidc*/ad_erp/Adempiere/jboss/server/adempiere/";
	elif [[ "opc" == "$app" ]]; then
		base="/usr/local/app/vm.common.gzidc.area/php_sellerportal/"
		# year=$(ls $base|grep 2|sort -r | awk 'NR==1 {print $1}');
		# month=$(ls -t $base/$year | awk 'NR==1 {print $1}')
		# log=$(ls -t $base/$year/$month | awk 'NR==1 {print $1}');

		logPath=$base;

	else
		logPath="/usr/local/app/*gzidc*/tomcat_$app/"
	fi
	
	cd $logPath;

	ls;

	echo "已经跳转到:$logPath"; 
}

main;